package com.situ.mall.web.controller;

import com.situ.mall.common.service.IMemberService;
import com.situ.mall.common.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class LoginController {

    @Autowired
    private IMemberService memberService;

    //注册
    @PostMapping("/register")
    public ResultVO register(String phoneNumber, String password){
        return memberService.register(phoneNumber, password);
    }

    //登陆
    @PostMapping("/login")
    public ResultVO login(String phoneNumber, String password){
        return memberService.check(phoneNumber,password);
    }
}
